package com.slkj.shilixiaoyuanapp.entity;

import com.contrarywind.interfaces.IPickerViewData;
import com.slkj.shilixiaoyuanapp.view.choosedialog.ChooseData;

import java.util.List;

/**
 * Created  on 2018-08-01
 *
 * @author 唐开阔
 * @describe 布置作业==发布对象，+作业类型 + 科目
 */
public class HomeWorkInfoEntity {


    private List<SubjectEntity> subject;
    private List<GradeEntity> grade;
    private List<HomeworkTypeEntity> homeworkType;

    public List<SubjectEntity> getSubject() {
        return subject;
    }

    public void setSubject(List<SubjectEntity> subject) {
        this.subject = subject;
    }

    public List<GradeEntity> getGrade() {
        return grade;
    }

    public void setGrade(List<GradeEntity> grade) {
        this.grade = grade;
    }

    public List<HomeworkTypeEntity> getHomeworkType() {
        return homeworkType;
    }

    public void setHomeworkType(List<HomeworkTypeEntity> homeworkType) {
        this.homeworkType = homeworkType;
    }

    public static class SubjectEntity implements IPickerViewData {
        /**
         * id : 2
         * name : 数学
         */

        private int id;
        private String name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String getPickerViewText() {
            return name;
        }
    }

    public static class GradeEntity implements ChooseData {
        /**
         * cId : 1
         * className : 2017级1班
         */

        private int cId;
        private String className;
        private  int year;

        public int getYear() {
            return year;
        }

        public void setYear(int year) {
            this.year = year;
        }

        public int getcId() {
            return cId;
        }

        public void setcId(int cId) {
            this.cId = cId;
        }

        public int getCId() {
            return cId;
        }

        public void setCId(int cId) {
            this.cId = cId;
        }

        public String getClassName() {
            return className;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        @Override
        public String getChooseDataText() {
            return className;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj instanceof  GradeEntity) {
                GradeEntity entity = (GradeEntity) obj;
                return entity.getYear() == year;
            }
            return false;
        }
    }

    public static class HomeworkTypeEntity implements IPickerViewData{
        /**
         * id : 1
         * name : 作业本
         */

        private int id;
        private String name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
        @Override
        public String getPickerViewText() {
            return name;
        }
    }
}
